/**
 * @file 工单操作-开发票
 * @author yangjiangming <449654337@qq.com>
 * @date 2018-12-10 20:13:16
 */
layui.extend({
    oms_work_modify_route: 'work/modify/common/zmn.modify.route'
}).define(['oms_work_modify_route'], function (exports) {
    const route = layui.oms_work_modify_route;

    window.reloadDetail = function (workId, orderId) {
        window.location.href = route._calculateHostForOMS() + '/work/modify/detail.action?orderId='+ orderId +'&workId='+ workId +'&operateId=103&moduleId=510';
    };

    function initPage() {
        // 构建URL
        let host = route._calculateHostForOMS();
        switch (moduleId) {
            case 1013:
                host = route._calculateHostForERP();
                break;
            case 1014:
                host = route._calculateHostForOMS();
                break;
            case 1035:
                host = route._calculateHostForTRACK();
                break;
        }
        let fullUrl = host + url;
        $("#embed-iframe").attr('src', fullUrl);
    }

    // 程序入口
    function init() {
        initPage();
    }

    // 初始化
    init();

    exports('oms_work_modify_embed');
});
